<?php
include 'config.php';

$sql = "SELECT s.*,n.number_name,b.breed_name,t.type_name FROM stock_goods_log s left join `number` n on s.number_id=n.number_id left join breed b on s.breed_id=b.breed_id left join type t on s.type_id=t.type_id WHERE 1 ORDER BY s.stock_goods_id DESC LIMIT 0,15";
$rs = $mysql->execute($sql);
$array = array();
$n = 0;
while($row = mysql_fetch_assoc($rs)){
	$n = $n;
	$num = $n%2;
	$row['num'] = $num;
	$array[] = $row;
	$n++;
}

$sql1 = "SELECT buy.*,n.number_name,b.breed_name,t.type_name,g.guest_name FROM buy_goods_log buy left join `number` n on buy.number_id=n.number_id left join breed b on buy.breed_id=b.breed_id left join type t on buy.type_id=t.type_id left join guest g on buy.guest_id=g.guest_id WHERE 1 ORDER BY buy.buy_goods_id DESC LIMIT 0,15";
$rs1 = $mysql->execute($sql1);
$array1 = array();
$n1 = 0;
while($row1 = mysql_fetch_assoc($rs1)){
	$n1 = $n1;
	$num1 = $n1%2;
	$row1['num1'] = $num1;
	$array1[] = $row1;
	$n1++;
}
$time = date("Y-m-d",time());
$smarty->assign('time',$time);
$smarty->assign('link', 3);
$smarty->assign('arr', $array);
$smarty->assign('arr1', $array1);
$smarty->display('sell.html');